﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Clandestine.Battle
{
    public delegate void BattleAnimation();

    /// <summary>
    /// This will be the animation loop of the battle system. It has a queue - obviously, of animations that need to occur
    /// in the form of delegates.
    /// </summary>
    public class AnimationQueue
    {
        private List<BattleAnimation> queue = new List<BattleAnimation>();
        public bool Stop = false; 

        public void Add(BattleAnimation be)
        {
            lock (queue)
                queue.Add(be);
        }

        public void PlayQueue()
        {
            for (int i = 0; i < queue.Count; i++)
            {
                if (queue[i] != null)
                    queue[i]();
            }
            queue.Clear();
        }
    }
}
